package org.flower.web.servlet;

import org.flower.service.OrderService;
import org.flower.service.impl.OrderServiceImpl;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(value = "/UpdateStateServlet.shtml")
public class UpdateStateServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String id = request.getParameter("id");
        OrderService orderService = new OrderServiceImpl();
        if (orderService.updateDing(id)){
            response.sendRedirect("viewDetails.jsp");
        }else {
            response.sendRedirect("viewDetails.jsp");
        }

    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
